package cn.wuxing.mediation.businessplatform.domain.enums;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: <描述>
 * @date: 2024/9/16 22:19
 * @author: yang
 * @version: 1.0
 */
@Getter
@AllArgsConstructor
public enum EventStateEnum {

    // 1.待分派 2.受理退回 3.待受理 4.待调解 5.二次引调待分派 6.二次引调待受理 7.二次引调待调解 8.待结案 9.已结案

    WAIT_ASSIGN(1, "待分派", "一次引调待分派"),

    ACCEPT_RETURN(2, "转窗口确认", "转窗口确认"),

    WAIT_ACCEPT(3, "待受理", "一次引调待受理"),

    WAIT_MEDIATE(4, "待调解", "一次引调待调解"),

    WAIT_SECOND_ASSIGN(5, "待二次分派", "二次引调待分派"),

    WAIT_SECOND_ACCEPT(6, "待二次受理", "二次引调待受理"),

    WAIT_SECOND_MEDIATE(7, "待二次调解", "二次引调待调解"),

    WAIT_CLOSE(8, "待结案", "待结案"),

    WAIT_SECOND_CLOSE(9, "待结案", "待结案"),

    CLOSE(10, "已结案", "已结案");

    private final Integer code;

    private final String desc;

    private final String descEn;

    public static String getDesc(Integer code) {
        for (EventStateEnum eventStateEnum : EventStateEnum.values()) {
            if (eventStateEnum.getCode().equals(code)) {
                return eventStateEnum.getDesc();
            }
        }
        return null;
    }

    public static String getDescEn(Integer code) {
        for (EventStateEnum eventStateEnum : EventStateEnum.values()) {
            if (eventStateEnum.getCode().equals(code)) {
                return eventStateEnum.getDescEn();
            }
        }
        return null;
    }

    /**
     * 待受理状态
     * @return
     */
    public static List<Integer> getWaitAcceptStateList() {
        return Stream.of(WAIT_ACCEPT.getCode(), WAIT_SECOND_ACCEPT.getCode()).collect(Collectors.toList());
    }

    /**
     * 待调解状态
     * @return
     */
    public static List<Integer> getWaitMediateStateList() {
        return Stream.of(WAIT_MEDIATE.getCode(), WAIT_SECOND_MEDIATE.getCode()).collect(Collectors.toList());
    }
}
